home *** CD-ROM | disk | FTP | other *** search
- Path: jpmorgan.com!usenet
- From: Oliver Peck <peck_oliver@jpmorgan.com>
- Newsgroups: comp.lang.c++
- Subject: Exceptions, shared libraries & SparcWorks
- Date: Mon, 15 Apr 1996 16:05:41 +0100
- Organization: JP Morgan
- Message-ID: <317265C5.167EB0E7@jpmorgan.com>
- NNTP-Posting-Host: gm-fitrades4.uk.jpmorgan.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m)
-
- I am using V4.0.1 of the SparcWorks C++ compiler on SunOS 4.1.3_U1.
-
- I have an executable which calls a shared library which calls another
- shared library in the following manner:-
-
- Executable
- ----------
-
- try
- {
- pDerivedObject = new DerivedObject( params );
- }
- catch ( const MyException & )
- {
- // Do something
- }
-
-
- Shared library 1
- ----------------
-
- DerivedObject::DerivedObject( PARAMS params ) throw( MyException )
-
- : Object( params )
- {
- try
- {
- Object object( different_params );
-
- // Use some stuff from object
- }
- catch( const MyException & )
- {
- // Do something
- }
-
- }
-
- Shared library 2
- ----------------
-
- Object::Object( PARAMS params ) throw( MyExeption )
-
- {
- // Do something
-
- if ( error )
- throw( MyException() );
-
- }
-
-
- (Object is a base class of DerivedObject)
-
- Strangely, if the object( different_params ) constructor throws,
- this is only caught by the catch in the executable, completely missing
- the DerivedObject() catch.
-
- If I statically link the libraries with the executable, all works fine.
-
- I have tried to understand the "documentation" in the compiler Library
- Reference Manual on shared libraries, but although I am using the -G
- option, I am not doing any of the __init_lib_, _init_foo_, __dummmy_foo
- stuff as I do not really understand it and cannot get it to work anyway.
-
- Also, what is the .sa file for. It gets created but 1 do not use it at
- link or run time?
-
- All suggestions gratefully received.
-
- Regards
-
- Oliver
-